Optimal. Leaf size=42 \[ -\frac {a \tanh ^{-1}(\sin (e+f x))}{c f}-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {4042, 3855}
\begin {gather*} -\frac {a \tanh ^{-1}(\sin (e+f x))}{c f}-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3855
Rule 4042
Rubi steps
\begin {align*} \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{c-c \sec (e+f x)} \, dx &=-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))}-\frac {a \int \sec (e+f x) \, dx}{c}\\ &=-\frac {a \tanh ^{-1}(\sin (e+f x))}{c f}-\frac {2 a \tan (e+f x)}{f (c-c \sec (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 77, normalized size = 1.83 \begin {gather*} -\frac {a \left (-\frac {2 \cot \left (\frac {1}{2} (e+f x)\right )}{f}-\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}\right )}{c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 50, normalized size = 1.19
method | result | size |
derivativedivides | \(\frac {2 a \left (-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2}+\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f c}\) | \(50\) |
default | \(\frac {2 a \left (-\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2}+\frac {\ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2}+\frac {1}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}\right )}{f c}\) | \(50\) |
risch | \(\frac {4 i a}{f c \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{c f}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{c f}\) | \(68\) |
norman | \(\frac {-\frac {2 a}{c f}+\frac {2 a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}+\frac {a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{c f}-\frac {a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{c f}\) | \(100\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 109 vs.
\(2 (46) = 92\).
time = 0.27, size = 109, normalized size = 2.60 \begin {gather*} -\frac {a {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c} - \frac {\cos \left (f x + e\right ) + 1}{c \sin \left (f x + e\right )}\right )} - \frac {a {\left (\cos \left (f x + e\right ) + 1\right )}}{c \sin \left (f x + e\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.50, size = 72, normalized size = 1.71 \begin {gather*} -\frac {a \log \left (\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - a \log \left (-\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 4 \, a \cos \left (f x + e\right ) - 4 \, a}{2 \, c f \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {a \left (\int \frac {\sec {\left (e + f x \right )}}{\sec {\left (e + f x \right )} - 1}\, dx + \int \frac {\sec ^{2}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} - 1}\, dx\right )}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.57, size = 60, normalized size = 1.43 \begin {gather*} -\frac {\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{c} - \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{c} - \frac {2 \, a}{c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.85, size = 31, normalized size = 0.74 \begin {gather*} -\frac {2\,a\,\left (\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{c\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________